<!--#include file="../inc/conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="ui/css/layui.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="ui/jquery.js"></script>


</head>




<body>
<div style="padding:15px;">
 
      <form id="form1" name="form1" class="layui-form" method="post" action="?act=add">
  	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr >
    <td height="40" >活动名称</td>
    <td><input name="title" type="text" class="layui-input" id="sttime"  style="width:250px;"  lay-verify="required" /></td>
   
    <td colspan="3" >
      <table  border="0" cellspacing="0" cellpadding="0">
        <tr>
        <td>起止时间　</td>
          <td><input name="sttime" type="text" class="layui-input date" id="sttime"  style="width:150px;"  lay-verify="required" /></td>
          <td width="30" align="center">至</td>
          <td><input name="endtime" type="text" class="layui-input date" id="endtime"  style="width:150px;"  lay-verify="required" /></td>
          </tr>
        </table>   
    </td>
        </tr>
      
  <tr>
    <td height="40">抽奖状态</td>
    <td><input type="checkbox"  name="zt" lay-skin="switch" lay-filter="istj" lay-text="开启|关闭" value="1" checked="checked" /></td>
    <td>
    <label class="layui-form-label">几率基数</label>
      <input name="jljs" type="text" class="layui-input" id="dhjf"  style="width:200px; float:left"  lay-verify="number" placeholder="填100或者1000或者10000"/>
  <i class="layui-icon layui-icon-tips tips" tips="奖品几率 / 基数=中奖几率" style=" float:left; color:#999999;font-size:20px; margin-left:10px; margin-top:7px;"  > </i> 
      </td>
    <td><label class="layui-form-label" >抽奖次数:</label>
 
      <input name="cnum" type="text" class="layui-input" id="dhjf2"  style="width:50px; float:left"  lay-verify="number" />
  
     
      <label class="layui-form-mid">次</label></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>奖品设置</td>
    <td colspan="4">
     
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="layui-table">
    <thead>
    <td>序号</td>
        <td>奖品名称</td>
        <td>奖品图片</td>
        <td>奖品几率 <i class="layui-icon layui-icon-tips tips" tips="相加之和应该等于几率基数" style="color:#999999;font-size:20px; margin-left:10px; margin-top:7px;"  > </i> 
</td>
        <td>奖品数量</td>
        <td>无奖品<i class="layui-icon layui-icon-tips tips" tips="如果勾选则提示不中奖，不会纪录中奖" style="color:#999999;font-size:20px; margin-left:10px; margin-top:7px;"  > </i> 
</td>
          <td>默认中奖<i class="layui-icon layui-icon-tips tips" tips="如果开出奖品数量为0或者跳空则默认开出此奖项" style="color:#999999;font-size:20px; margin-left:10px; margin-top:7px;"  > </i></td>
    </thead>
    <% for lot_i=0 to 7
		%>
      <tr>
        <td><%=lot_i+1%></td>
        <td><input name="name" type="text" class="layui-input"   style="width:150px;"  lay-verify="required" value="" /></td>
    <td>
      <input name="pic" type="hidden" value="" />
  <div  class="upload" >
  <i class="layui-icon">&#xe67c;</i>上传图片
 
</div>

     </td>
        <td><input name="jl" type="text" class="layui-input"  style="width:50px;float:left"  lay-verify="number" placeholder="数字" value=""/>

        </td>
        <td><input name="num" type="text" class="layui-input"  style="width:80px;"  lay-verify="number" placeholder="填写数字" value=""/></td>
        <td>  <input type="checkbox" name="iswu" id="checkbox" lay-skin="primary" title="是" value="" />

        </td>
        <td>  <input type="radio" name="ismr" id="checkbox" lay-skin="primary" title="是" value="<%=lot_i%>" <%if lot_i=0 then%>checked="checked" <%end if%>/></td>
      </tr>
      <%next%>
    </table>
      
        </td>
    </tr>
  <tr>
    <td height="50" width="100">规则说明</td>
    <td height="50" colspan="4"><textarea name="info" class="layui-textarea" ></textarea>
      
      </td>
  </tr>
  
  <tr>
    <td height="50">&nbsp;</td>
    <td colspan="4"><input name="input" type="submit" class="layui-btn" value="添加"  lay-submit="lay-submit" /></td>
    </tr>
      </table>
    </form>
    
  </div> 
    
    
 
 
   

<script type="text/javascript" src="ui/layui.js"></script>

	

<script type="text/javascript" src="ui/main.js"></script>


<%
  if request("act")="add" then


sql="select * from [lottery]"
        rs.open sql,conn,3,3
	
        rs.addnew
		rs("title")=request("title")
	
rs("sttime")=request("sttime")
		rs("endtime")=request("endtime")
		rs("zt")=request("zt")
		rs("jljs")=request("jljs")
		rs("cnum")=request("cnum")
		rs("name")=request("name")
		rs("pic")=request("pic")
		rs("ismr")=request("ismr")	
		rs("iswu")=request("iswu")	
		rs("info")=request("info")
		rs("jl")=request("jl")	
		rs("num")=request("num")
	
		rs("intime")=now()
	   
        rs.update
		rs.close
		
response.Write"<script>alert('添加成功'); parent.location.reload();</script>"
end if
	

		set rs=nothing
 
%>
   
</body>

</html>
